package com.twu.biblioteca.Model;

import com.twu.biblioteca.Entity.Book;

import java.util.HashMap;
import java.util.Map;

public class BookList {
    private static Map<String, Book> bookList = new HashMap<String, Book>();

    public BookList() {
        bookList.put("001", new Book("001", "C++", false, null));
        bookList.put("002", new Book("002", "C#", false, null));
        bookList.put("003", new Book("003", "Java", false, null));
    }

    public Map<String, Book> getBookList() {
        return bookList;
    }

    public void updateBookList(String id, boolean isCheckOut, String borrower) {
        bookList.put(id, new Book(id, bookList.get(id).getBookName(), isCheckOut, borrower));
    }
}
